<template>
	<view class="mainpadding">
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:'',
				type:1,//1用户协议，2隐私政策
			}
		},
		onLoad(options) {
			this.type = options.type
			if(options.type==1){
				uni.setNavigationBarTitle({
					title:"用戶協議"
				})
			}else if(options.type==2){
				uni.setNavigationBarTitle({
					title:"隱私政策"
				})
			}
			this.get()
		},
		methods: {
			async get(){
				let res = await this.http.request('/api/index/getConfigInfoItem', 'GET', {
					pidtype:"about_set",
					type:this.type==1?'shop_xy':'shop_yszc'
				})
				if (res.code == 1) {
					
					this.content=res.data
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			}
		}
	}
</script>

<style>

</style>
